﻿<%@ Page Title="" Language="C#" MasterPageFile="Navegacion.master" AutoEventWireup="true"
    CodeBehind="Facturacion.aspx.cs" Inherits="autogestionAVEIT.Facturacion" %>

<asp:Content ID="Content1" ContentPlaceHolderID="NavegacionHead" runat="server">
<script type="text/javascript">
    $(document).ready(function () {
        $('.solo-numero').keyup(function () {
            this.value = (this.value + '').replace(/[^0-9]/g, '');
        });
    });
    </script>
       
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="NavegacionBody" runat="server">
    <div class="container-fluid">
        <asp:Panel ID="panel_encabezado" runat="server">
            <div class="col-sm-12">
                <hr />
                <h2 class="intro-text text-center">
                    <asp:Label ID="lbl_encabezado1" runat="server" Text=" "></asp:Label>
                    <strong>
                        <asp:Label ID="lbl_encabezado2" runat="server" Text="Facturación"></asp:Label>
                    </strong>
                </h2>
                <hr />
                <div class="col-sm-2 col-sm-offset-5 panel panel-bordered text-center" style="border-style: solid;
                    border-color: #CCCCCC">
                    <strong>
                        <asp:Label ID="lblTipoFactura" runat="server" Text="C" Font-Size="XX-Large"></asp:Label>
                    </strong>
                </div>
            </div>
        </asp:Panel>
        <asp:Panel ID="panel_mensaje" CssClass="alert-danger text-center" runat="server"
            Visible="false">
            <div class="row col-sm-12">
            </div>
            <div class="container col-sm-6 col-sm-offset-3 panel-collapse">
                <asp:Label ID="lblMensajeHeader" CssClass="alert-danger text-center" runat="server" Font-Size="X-Large" />
            </div>
        </asp:Panel>
        <asp:Panel ID="panel_cuerpo" runat="server">
            <div class="form col-sm-5 col-sm-offset-1 ">
                
                <div class="panel panel-default col-sm-12 ">
                    <div class="panel-heading">
                        <strong>Factura </strong>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <asp:Label ID="lblNroFactura" Text="Nro de Factura:" AssociatedControlID="txtNroFactura"
                                    runat="server" />
                                <asp:TextBox ID="txtNroFactura" runat="server" class="form-control solo-numero" ></asp:TextBox>
                            </div>
                            <div class="col-sm-12">
                                <br />
                                <asp:Label ID="lblTipoIVA" Text="Condición frente al IVA:" AssociatedControlID="ddlTipoIVA"
                                    runat="server" />
                                <asp:DropDownList ID="ddlTipoIVA" runat="server" class="form-control"></asp:DropDownList>
                                <br />
                                <asp:Label ID="lblTipoPago" Text="Tipo de Pago:" AssociatedControlID="ddlTipoPago"
                                    runat="server" />
                                <asp:DropDownList ID="ddlTipoPago" runat="server" class="form-control"></asp:DropDownList>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form col-sm-5 ">
                <div class="panel panel-default col-sm-12 ">
                    <div class="panel-heading">
                        <strong>Socio </strong>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-sm-6">
                                <asp:Label ID="lblNroSocio" Text="Nro de Socio:" AssociatedControlID="txtNroSocio"
                                    runat="server" />
                                <asp:TextBox ID="txtNroSocio" runat="server" class="form-control text-right solo-numero"></asp:TextBox>
                                <br />
                            </div>
                            <div class="col-sm-6">
                                <asp:Label ID="lblNumeroDocumento" Text="Nro de Documento:" AssociatedControlID="txtDocumento"
                                    runat="server" />
                                <asp:TextBox ID="txtDocumento" runat="server" class="form-control text-right" ></asp:TextBox>
                                <br />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6">
                                <asp:Label ID="lblNombre" Text="Nombre:" AssociatedControlID="txtNombre" runat="server" />
                                <asp:TextBox ID="txtNombre" runat="server" class="form-control" ></asp:TextBox>
                            </div>
                            <div class="col-sm-6">
                                <asp:Label ID="lblApellido" Text="Apellido:" AssociatedControlID="txtApellido" runat="server" />
                                <asp:TextBox ID="txtApellido" runat="server" class="form-control" ></asp:TextBox>
                                <br />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
                                <asp:Label ID="lblDomicilio" Text="Domicilio:" AssociatedControlID="txtDomicilio"
                                    runat="server" />
                                <asp:TextBox ID="txtDomicilio" runat="server" class="form-control" ></asp:TextBox>
                                <br />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 col-sm-offset-3">
                                <asp:Button ID="btn_BuscarSocio" runat="server" Text="Cargar Socio" 
                                    class="btn btn-primary" onclick="btn_BuscarSocio_Click"/>
                                <br />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </asp:Panel>
        <asp:Panel ID="panel_grilla" runat="server">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="panel panel-default col-sm-12 ">
                    <div class="panel-heading">
                        <strong>Detalle de Boletas </strong>
                    </div>
                    <div class="panel-body">
                        <div class="table-responsive col-sm-12">
                            <asp:GridView ID="GVBoletas" runat="server" class="filtrar table"
                                ForeColor="#333333" GridLines="None" EmptyDataText="No se encontraron Boletas para el socio..."
                                OnPageIndexChanging="GVBoletas_PageIndexChanging" 
                                OnSelectedIndexChanged="GVBoletas_SelectedIndexChanged" 
                                AutoGenerateColumns="False" DataKeyNames="registroBoleta">
                                <AlternatingRowStyle BackColor="White" />
                                <Columns>
                                    <asp:BoundField DataField="registroBoleta" HeaderText=" cod Boleta" />
                                    <asp:BoundField DataField="numeracion" HeaderText="Boleta Nro" />
                                    <asp:BoundField DataField="año" HeaderText="Año" />
                                    
                                    <asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkCupon1"  runat="server" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    
                                    <asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center" runat="server">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkCupon2" runat="server" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>

                                    <asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkCupon3" runat="server"/>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>

                                    <asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkCupon4" runat="server" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>

                                    <asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkCupon5" runat="server"/>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>

                                    <asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkCupon6" runat="server" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    
                                </Columns>
                                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="ControlDarkDark" Font-Bold="True" ForeColor="white" />
                                <PagerStyle BackColor="ControlDarkDark" Font-Bold="True" ForeColor="white" HorizontalAlign="center" />
                                <RowStyle BackColor="Control" ForeColor="#333333" />
                                <SelectedRowStyle BackColor="#250169" Font-Bold="True" ForeColor="#BBBBFF" BorderColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#FDF5AC" />
                                <SortedAscendingHeaderStyle BackColor="#4D0000" />
                                <SortedDescendingCellStyle BackColor="#FCF6C0" />
                                <SortedDescendingHeaderStyle BackColor="#820000" />
                            </asp:GridView>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-4 col-sm-offset-3">
                <div class="row col-sm-12">
                    <br />
                 
                    <br />
                    <div class="row col-sm-9">
                        <br />
                        <asp:Button ID="btnCalcularImporte" runat="server" Text="Calcular Importe" 
                            class="btn btn-primary form-control" onclick="btnCalcularImporte_Click" />
                    </div>
                    <div class="row col-sm-9">
                        <br />
                        <asp:Button ID="btnGrabarFactura" runat="server" Text="Confirmar" 
                            class="btn btn-success form-control" onclick="btnGrabarFactura_Click" />
                    </div>
                    <div class="row col-sm-9">
                        <br />
                        <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" 
                            class="btn btn-warning form-control" onclick="btnCancelar_Click" />
                    </div>
                </div>
            </div>
            <div class="col-sm-3 panel panel-default">
                <div class="col-sm-12">
                    <br />
                    <asp:Label ID="lblSubTotal" Text="Sub-Total:" AssociatedControlID="txtSubTotal" runat="server" />
                    <asp:TextBox ID="txtSubTotal" runat="server" class="form-control  text-right"></asp:TextBox>
                    <br />
                </div>
                <div class="col-sm-12">
                    <asp:Label ID="lblIVA" Text="IVA:" AssociatedControlID="txtIVA" runat="server" />
                    <asp:TextBox ID="txtIVA" runat="server" class="form-control text-right" ></asp:TextBox>
                    <br />
                </div>
                <div class="col-sm-12">
                    <asp:Label ID="lblTotal" Text="Total:" AssociatedControlID="txtTotal" runat="server" />
                    <asp:TextBox ID="txtTotal" runat="server" class="form-control  text-right " Font-Bold="True" Font-Size="Large"></asp:TextBox>
                    <br />
                </div>
            </div>
        </asp:Panel>
        <asp:Panel ID="panel_footer" runat="server">
            <div class="col-sm-12">
                <asp:Button ID="btnAsignarBoletas" runat="server" Text="Asignar Boletas" class="btn btn-primary" Visible="false"
                    OnClick="btnAsignarBoletas_Click" />
            </div>
        </asp:Panel>
    </div>
</asp:Content>
